/**
 * 
 */
package uk.co.cdal.cobweb.frontend.GUI;

import java.awt.GridLayout;
import java.io.Serializable;
import java.util.ArrayList;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 * @author seb
 *
 */
public class ImagePanel extends JPanel implements Serializable {
	
	public ImagePanel(ArrayList<ImageIcon> images) {
		/* Set the grid layout up so the number of 
		 *rows is equal to the number of elements in the arraylist 
		 */
		setLayout(new GridLayout(images.size() + 1, 1));
		
		/*
		 * For each image add a button to remove the image
		 * Add an extra space for button to add a new Image 
		 */
		for(int i = 0; i < images.size(); i++) {
			ImageDisplay id = new ImageDisplay(images.get(i));
			id.setEnabled(true);
			add(id);
		}
		
		ImageDisplay id = new ImageDisplay();
		id.setEnabled(true);
		add(id);
	}
	

}
